var oH4=document.querySelector('#selectDate h4');
var oUI=document.querySelector('#selectDate ul');
var aLi=document.querySelectorAll('#selectDate li');

oH4.onclick=function(){
    oUI.style.display='block'
    event.cancelBubble=true
}

for(var i=0;i<aLi.length;i++){
    aLi[i].onclick=function(){
        oUI.style.display='none'
        oH4.innerHTML=this.innerHTML
    }
}

document.onclick=function(){
    oUI.style.display='none'
}
